<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, width=device-width, height=device-height" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<SCRIPT type="text/javascript" src="../js/jquery-1.8.2.js"></SCRIPT>
<SCRIPT type="text/javascript">
	$(document).ready(function() {
		$("#rboardList").load("../reviewboard/ReviewList.htm");
		$("#boardList").load("../board/Q&AList.htm");
		$("#btnCart").click(function() {
			$("#form").attr({
				action : 'cart.htm'
			}).submit();
		});
		$("#btnOrder").click(function() {
			$("#form").attr({
				action : 'order.htm'
			}).submit();
		});
	});
</SCRIPT>
<link href="../css/shop.style.css" rel="stylesheet" />
</head>
<body>
	<table>
		<tr>
			<td></td>
		</tr>
		<tr>
			<td></td>
			<td>
				<center>
					<form id="form" method="post">
						<table>
							<tr>
								<td rowspan="8"><img src="../images/${product.prodImage}" width="300" height="300"></td>
							</tr>
							<tr height="1">
								<td colspan="2"><font size="3"><strong>${product.prodName}</strong></font></td>
							</tr>
							<tr>
								<td align="center" colspan="2">
									<table bgcolor="lightblue">
										<tr>
											<th>가격</th>
											<td><fmt:formatNumber value="${product.prodOutPrice}" pattern="###,###,###" /> 원</td>
										</tr>
										<tr>
											<th>적립금</th>
											<td><fmt:formatNumber value="${product.prodOutPrice*0.01}" pattern="###,###,###" />원</td>
										</tr>
										<tr>
											<th>배송비</th>
											<td>2000원</td>
										</tr>
									</table>
								</td>
							</tr>

							<tr>
								<td colspan="2">${product.prodDesc}</td>
							</tr>
							<tr>
								<td>제조사</td>
								<td>${product.prodMaker}</td>
							</tr>
							<tr>
								<td>원산지</td>
								<td>${product.prodCountry}</td>
							</tr>
							<tr>
								<td>수량</td>
								<td><select name="quantity">
										<c:forEach begin="1" end="${product.prodStock}" var="q">
											<option value="${q}">${q}</option>
										</c:forEach>
								</select></td>
							</tr>
							<tr>
								<td colspan="2">
								<input type="button" value="구매" id="btnOrder"> 
								<input type="button" value="장바구니" id="btnCart"> 
								<input type="hidden" name="prodCode" value="${product.prodCode}">
								</td>
							</tr>
						</table>
					</form>
					<hr color="lightblue">
					<div id="guidance"></div>
					<jsp:include page="guidance.html" />
					<table>
						<tr bgcolor="lightblue" align="left">
							<td>이용후기</td>
						</tr>
						<tr>
							<td align="left">
								<div id="rboardList"></div> 
							</td>
						</tr>
						<tr bgcolor="lightblue" align="left">
							<td>상품Q&A</td>
						</tr>
						<tr>
							<td align="left">
								<div id="boardList"></div> 
							</td>
						</tr>
					</table>
				</center>
			</td>
		</tr>
	</table>
</body>
</html>